package org.glow.changgou;


import org.glow.changgou.entity.IdWorker;
import org.glow.changgou.entity.MyFeignInterceptor;
import org.glow.changgou.entity.TokenDecode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 描述
 *
 * @author glow
 * @version 1.0
 * @package org.glow.changgou *
 * @since 1.0
 */
@SpringBootApplication
@EnableEurekaClient
@EnableScheduling
@EnableFeignClients(basePackages = {"org.glow.changgou.goods.feign","org.glow.changgou.user.feign","org.glow.changgou.pay.feign"})
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }
    /**
     * 解析用户令牌
     */
    @Bean
    public TokenDecode tokenDecode()
    {
        return  new TokenDecode();
    }
    @Bean
    public IdWorker idWorker(){
        return new IdWorker(1,1);
    }
    @Bean
    public MyFeignInterceptor myFeignInterceptor()
    {
        return  new MyFeignInterceptor();
    }
}
